//=============================================================================
// TF Thrust Boots, Multi jump boots
//=============================================================================
class TFThrustBoots extends TFPowerups;

var int mjcounter;

state Activated
{
	function BeginState()
	{
//		local Emitter ThrustSmoke;

        initialstate='activated';
        if(instigator==none) instigator=pawn(owner);
        Owner.PlaySound(ActivateSound,SLOT_Interface,4);
        bActive = true;

        xpawn(owner).MaxFallSpeed=xpawn(owner).Default.MaxFallSpeed*1.5;
        xpawn(owner).MaxMultiJump=999;
        xpawn(owner).MultiJumpRemaining=999;
        xpawn(owner).MultiJumpBoost=25;

        mjcounter=999;
    }

	function EndState()
	{
        bActive = false;
	}

    function Timer()
    {

    }

	function Activate()
	{

	}

    function Tick(float Deltatime)
    {
        local Emitter ThrustSmoke;

        if(xpawn(owner).MultiJumpRemaining==999) xpawn(owner).MultiJumpBoost=25;

        if(xpawn(owner).MultiJumpRemaining!=mjcounter)
        {
            ThrustSmoke=Spawn(class'TaskForces.TFTBootsSmoke', xPawn(Owner),, xPawn(Owner).Location);
		    xPawn(Owner).AttachToBone(ThrustSmoke, 'lfoot');
    	    ThrustSmoke=Spawn(class'TaskForces.TFTBootsSmoke', xPawn(Owner),, xPawn(Owner).Location);
    	    xPawn(Owner).AttachToBone(ThrustSmoke, 'rfoot');

            if(xpawn(owner).MultiJumpBoost>0)
                xpawn(owner).MultiJumpBoost-=1;
            else xpawn(owner).MultiJumpBoost-=2;

            Owner.PlaySound(sound'TFMedia.TFTBootsThrust',SLOT_Interface,float(xpawn(owner).MultiJumpBoost)/25+0.2,,,0.9+frand()/5);

            mjcounter=xpawn(owner).MultiJumpRemaining;
        }

        super.Tick(deltatime);
    }

	/*function OwnerEvent(name EventName)
    {
        local Emitter ThrustSmoke;

        if (EventName=='Jumped')
        {
		    ThrustSmoke=Spawn(class'TaskForces.TFTBootsSmoke', xPawn(Owner),, xPawn(Owner).Location);
		    xPawn(Owner).AttachToBone(ThrustSmoke, 'lfoot');
    	    ThrustSmoke=Spawn(class'TaskForces.TFTBootsSmoke', xPawn(Owner),, xPawn(Owner).Location);
    	    xPawn(Owner).AttachToBone(ThrustSmoke, 'rfoot');

            Owner.PlaySound(sound'TFMedia.TFTBootsThrust',SLOT_None,2);
        }

        if( Inventory != none )
            Inventory.OwnerEvent(EventName);
    }*/
}

defaultproperties
{
     bAutoActivate=True
     bActivatable=True
     ActivateSound=Sound'TFMedia.Equipment.TFTBootsActiv'
     bReplicateInstigator=True
     SkillCost=200
}
